#include "geometry.h"
#include <cmath>

double distance(Point p1, Point p2) {
    double dx = p1.x - p2.x;
    double dy = p1.y - p2.y;
    return std::sqrt(dx*dx + dy*dy);
}

Point create_point(double x, double y) {
    return Point{x, y};
}

double triangle_area(Point a, Point b, Point c) {
    double area = 0.5 * std::abs(
        (b.x - a.x) * (c.y - a.y) - 
        (c.x - a.x) * (b.y - a.y)
    );
    return area;
}